<?php

namespace app\admin\controller;


use app\admin\model\SystemModel;
use think\Request;

class Site extends Base
{
    /**
     * 站点管理页面
     * @return \think\response\View
     */
    public function index()
    {
        $data = SystemModel::getConfigInfo(['site']);
        return view('site/index', compact('data'));
    }

    /**
     * 系统设置保存
     * @param Request $request
     * @return \think\response\Json
     * @throws \think\Exception
     * @throws \think\exception\PDOException
     */
    public function save(Request $request)
    {
        return SystemModel::saveToAll($request->except(['AdminPersimmon', 'AdminAuth']));
    }
}
